﻿using System;
using System.Data;
using System.Collections.Generic;

namespace BLL.Sec
{
    /// <summary>
    /// 业务逻辑类SEC_ARMYCODE 的摘要说明。
    /// </summary>
    public class SEC_ARMYCODE
    {
     private readonly OracleDAL.Sec.SEC_ARMYCODE dal = new OracleDAL.Sec.SEC_ARMYCODE();
        public SEC_ARMYCODE()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string ARMYISN)
        {
            return dal.Exists(ARMYISN);
        }
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public bool ExistsBYwhere(string strWhere)
        {
            return dal.ExistsBYwhere(strWhere);
        }
         public int GetCount(string strWhere)
        {
            return dal.GetCount(strWhere);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Model.Sec.SEC_ARMYCODE model)
        {
           return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.Sec.SEC_ARMYCODE model)
        {
           return  dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string ARMYISN)
        {

           return dal.Delete(ARMYISN);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.Sec.SEC_ARMYCODE GetModel(string ARMYISN)
        {

            return dal.GetModel(ARMYISN);
        }

      

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.Sec.SEC_ARMYCODE> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List<Model.Sec.SEC_ARMYCODE> modelList = new List<Model.Sec.SEC_ARMYCODE>();
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > 0)
            {
                Model.Sec.SEC_ARMYCODE model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Model.Sec.SEC_ARMYCODE();
                    model.ARMYISN = ds.Tables[0].Rows[n]["ARMYISN"].ToString();
                    model.ARMYID = ds.Tables[0].Rows[n]["ARMYID"].ToString();
                    model.ARMYCODE = ds.Tables[0].Rows[n]["ARMYCODE"].ToString();
                    model.ARMYDESIGNATOR = ds.Tables[0].Rows[n]["ARMYDESIGNATOR"].ToString();
                    model.NODEINDEX = ds.Tables[0].Rows[n]["NODEINDEX"].ToString();
                    model.NODEID = ds.Tables[0].Rows[n]["NODEID"].ToString();
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
        /// <summary>
        /// 获得最大的armyid
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public string GetMaxID(string strWhere)
        {
            return dal.GetMaxID(strWhere);
        }
        public bool MoveNodeIndex(int i, string armyID)
        {
            return dal.MoveNodeIndex(i, armyID);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}

